# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=wput
pkgver=0.6.2
pkgrel=4
pkgdesc="A command line tool to upload files to FTP site"
url="https://wput.sourceforge.net/"
arch="all"
license="GPL-2.0-or-later"
makedepends="gnutls-dev"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/wput/wput-$pkgver.tgz
	$pkgname-destdir.patch"

# Fix build with gcc >= 10.X
export CFLAGS="$CFLAGS -fcommon"

prepare() {
	default_prepare

	update_config_guess && update_config_sub
}

build() {
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--disable-g-switch
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="e1d0fb8570cbda44c97215ee1a021a9867f2e91323b3d7f7df1d7fd68a1b2aba40a7f3068e5e85e8c736b1dba1fba62df375af99e3fb96cd0fd414b139c641bd  wput-0.6.2.tgz
d464d4395ffab7f1d8f2c0b293404b05979eb1f63600169b5344c286ecbf1209e20682c957a5319c7246d130438533f80484b30e4664e66fbc9cec6cebbb7eaf  wput-destdir.patch"
